import { EntitySchema } from '@mikro-orm/core';

export class TypechoUserapi {
  id!: number;
  headImgUrl?: string;
  openId?: string;
  accessToken?: string;
  appLoginType?: string;
  uid?: number = 0;
}

export const TypechoUserapiSchema = new EntitySchema({
  class: TypechoUserapi,
  properties: {
    id: { primary: true, type: 'number' },
    headImgUrl: { type: 'string', fieldName: 'headImgUrl', length: 255, nullable: true },
    openId: { type: 'string', fieldName: 'openId', length: 255, nullable: true },
    accessToken: { type: 'string', length: 255, nullable: true },
    appLoginType: { type: 'string', fieldName: 'appLoginType', length: 255, nullable: true },
    uid: { type: 'number', nullable: true, default: 0 },
  },
});
